/************************************************************
   Copyright 2008 Abhinav Pobbati

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*************************************************************/

#pragma once

#pragma unmanaged
#include <Common/Base/Math/SweptTransform/hkSweptTransform.h>
#pragma managed

namespace Havok4Xna {
	ref class HkVector4;
	ref class HkMatrix3;
	ref class HkQuaternion;
	ref class HkQsTransform;
	ref class HkRotation;

	public ref class HkTransform : public INativeReference {
	public:
		HkTransform();
		HkTransform(HkRotation ^r, HkVector4 ^v);
		HkTransform(HkTransform ^t);
		HkTransform(HkQuaternion ^q, HkVector4 ^v);

		void Set(HkQuaternion ^q, HkVector4 ^v);
		void SetIdentity();
		bool IsApproximatelyEqual(HkTransform ^t, float epsilon);
		void SetRotation(HkQuaternion ^q);
		void SetInverse(HkTransform ^t);
		void SetMul(HkTransform ^t1, HkTransform ^t2);
		void SetMul(HkQsTransform ^t1, HkTransform ^t2);
		void SetMulInverseMul(HkTransform ^t1, HkTransform ^t2);
		void SetMulEq(HkTransform ^t);
		void SetRows4(HkVector4 ^r0, HkVector4 ^r1, HkVector4 ^r2, HkVector4 ^r3);
		void SetMulMulInverse(HkTransform ^a, HkTransform ^b);
		bool IsOk();

		DECLARE_COMPLEX_PROPERTY_GETSET(HkVector4, Translation)
		DECLARE_COMPLEX_PROPERTY_GETSET(HkRotation, Rotation)

	internal:
		HK_CLASS_INTERNALS(HkTransform,hkTransform)
	};


	public ref class HkSweptTransform : public INativeReference {
	public:
		HkSweptTransform();
		void ApproxTransformAt(float time, HkTransform ^transformOut);
		float GetInterpolationValue(float t);
		float GetBaseTime();
		float GetInvDeltaTime();
		void InitSweptTransform(HkVector4 ^position, HkQuaternion ^rotation);

		DECLARE_COMPLEX_PROPERTY_GETSET(HkVector4, CenterOfMass0)
		DECLARE_COMPLEX_PROPERTY_GETSET(HkVector4, CenterOfMass1)
		DECLARE_COMPLEX_PROPERTY_GETSET(HkVector4, CenterOfMassLocal)
		DECLARE_COMPLEX_PROPERTY_GETSET(HkQuaternion, Rotation0)
		DECLARE_COMPLEX_PROPERTY_GETSET(HkQuaternion, Rotation1)

	internal:
		HK_CLASS_INTERNALS(HkSweptTransform,hkSweptTransform)
	};
}